package week04;
// import java.io.File;
import java.io.*;
import java.util.Scanner;
import java.util.StringTokenizer;

public class FileTokenTest {
   public static void main (String[] args)  throws FileNotFoundException
   {
      Scanner scan = new Scanner (new File ("/home/depit/Desktop/lucian.txt"));
      String sentence = scan.nextLine();
      // default delimiter is " \t\n\r\f"
      String delimiter = " ,\t";
      StringTokenizer tokens = new StringTokenizer(sentence, delimiter);
      System.out.printf("Number of elements: %d\n", tokens.countTokens());
      System.out.println("The tokens are:");
      while (tokens.hasMoreTokens())
         System.out.println(tokens.nextToken());
   }

    private static void readFile(String string) {
        throw new UnsupportedOperationException("Not yet implemented");
    }
}
